import {Component, OnInit, Input, Output, EventEmitter} from '@angular/core';
import {Router} from '@angular/router';

@Component({
  selector: 'list-item',
  templateUrl: 'app/list/item.component.html',
  styleUrls: ['app/list/item.component.css']
})

export class ListItemComponent implements OnInit {
  @Input() contact:any = {};
  //直接把泛型类型放在类后面，可以帮助我们确认类的所有属性都在使用相同的类型。
  @Output() routerNavigate = new EventEmitter<number>();//泛型类
  //@Output() routerNavigate:EventEmitter<number> = new EventEmitter();
  constructor() {}

  ngOnInit() {

  }

  goDetail(num: number) {
    this.routerNavigate.emit(num);
  }

}
